﻿using System;

namespace Microsoft.Coding4Fun.TweetCraft
{
    /// <summary>
    /// Provides data for an event raised when an error occurs.
    /// </summary>
    public class ErrorEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ErrorEventArgs"/> class.
        /// </summary>
        /// <param name="exception">The exception.</param>
        public ErrorEventArgs(Exception exception)
        {
            if (exception == null)
                throw new ArgumentNullException("exception");

            Exception = exception;
        }

        /// <summary>
        /// Gets or sets the <see cref="Exception"/> that describes the error.
        /// </summary>
        public Exception Exception { get; private set; }


    }
}
